package org.ishequ.contacts;

import java.util.List;

import org.ishequ.domain.MyContacts;
import org.ishequ.service.MyContactsService;

import android.content.OperationApplicationException;
import android.os.RemoteException;
import android.test.AndroidTestCase;
import android.util.Log;

public class ContactsTest extends AndroidTestCase {
	
	private static final String TAG = "ContactsTest" ;
	private static MyContactsService contactsService; 
	
	@Override
	protected void setUp() throws Exception {
		contactsService = new MyContactsService(this.getContext());
	}

	public void testGetContacts(){
		List<MyContacts> contacts = contactsService.getContacts();
		for(MyContacts contact : contacts){
			Log.i(TAG, contact.toString());
		}
	}
	
	
	public void testSaveContacts() throws RemoteException, OperationApplicationException{
		MyContacts contacts = new MyContacts("甄嬛", "15162454545", "zhenhuan@126.com");
		contactsService.saveContacts2(contacts);
	}
}
